package model.core;

import model.entity.NPC;
import utility.BidirectionalMap;

public class NPCLibrary {
	private BidirectionalMap<String, NPC> library = new BidirectionalMap<String, NPC>();
	
	private static NPCLibrary npcLibrary = null;
	
	private NPCLibrary(){
		
	}
	
	public static NPCLibrary getInstance(){
		if (npcLibrary == null){
			npcLibrary = new NPCLibrary();
		}
		return npcLibrary;
	}
	
	public NPC getNPC(String name){
		return library.getFromSecondSet(name);
	}
	
	public String getName(NPC n){
		return library.getFromFirstSet(n);
	}
	
	public void put(String name, NPC n){
		library.put(name, n);
	}
}
